<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">

<head>
  <title></title>
  <script src="lib.js" ></script>
  <script>
  function plot(){
    var iplist = $('ip').value;
    var delimiter = $('delimiter').value;
    if(delimiter=="linux") delimiter ="\n";
    if(delimiter=="windows") delimiter ="\r\n";
    var list = iplist.split(delimiter);
    for (i=0;i<list.length;i++){
       var coord = getcoord(list[i]);
    }
  }
  function putonmap(txt,ip){
    var latlong = txt.split(":");
    var point = new GPoint(latlong[1],latlong[0]);
    var marker = new GMarker(point);
    GEvent.addListener(marker,"click",function(){marker.openInfoWindowHtml(ip)});
    map.addOverlay(marker);
  }
  function getcoord(ip){
    new Ajax.Request('request.php?ip='+ip+'',
  {
    method:'get',
    onSuccess: function(transport){
      var response = transport.responseText || "no response text";
      putonmap(response,ip);
    },
    onFailure: function(){ alert('Something went wrong...') }
  });
  }
  </script>
</head>

<body>
